#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

#define PATH_FIFO "/home/yujiu/fifo"
int main(){
	int fd= open(PATH_FIFO,O_RDONLY);
	char buf[128];
	ssize_t res=0;
	while(1){
		memset(buf,0,sizeof(buf));
		res=read(fd,buf,sizeof(buf));
		if(res<=0)break;
		printf("%s",buf);
	}
	close(fd);
	return 0;
}
